#!/bin/bash
# 针对windows系统的发布脚本
rm -rf dist
rm -rf dist.tar
npm run dev1
tar -cvf dist.tar dist/*
scp -P 22 dist.tar root@140.249.54.198:/www/wwwroot/
ssh -p 22 -Tq root@140.249.54.198 << remotessh
rm -rf /www/wwwroot/jinhongying-spin/*
cd /www/wwwroot/jinhongying-spin
mv ../dist.tar ./
tar -xvf dist.tar
mv dist/* ./
rm -rf /www/wwwroot/jinhongying-spin/dist.tar
rm -rf /www/wwwroot/jinhongying-spin/dist/usr
exit
remotessh
